#!/usr/bin/env python

# show_csv.py

from __future__ import division

import math

from ot_simulator import graph
from ot_simulator.template import template_funs

Max_dimensions = 600

def to_cartesian(r, theta):
    theta = math.radians(theta)
    return r * math.cos(theta), r * math.sin(theta)

def run(csv, radius=2.0):
    template = template_funs.file_multi_num(csv)
                   
    g = graph.graph(Max_dimensions)
    #g.line((-semi_minor, -semi_major), (-semi_minor, semi_major),
    #       color="rgb(0, 255, 0)")
    g.plot(template)
    g.show()
    #g.write(csv[:-4] + ".png")


if __name__ == "__main__":
    import sys
    if len(sys.argv) != 2:
        print >> sys.stderr, "usage: {0} file.csv".format(sys.argv[0])
        sys.exit(2)
    run(sys.argv[1])
